/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package RuleInterence;

import Common.Constant;
import DataSource.Data;
import DataSource.DataEntry;

/**
 *
 * @author Tuan
 */
public class Hypotension extends HealthRuleAbs{

    public Hypotension(DataEntry dataEntry){
        super(dataEntry);
        this.symptom = "Hypotension";
    }
    
    public DiagnosticResult checkSymptom(Data data) {
        DiagnosticResult result = new DiagnosticResult(symptom, data);
        return data.getSystolic() >= this.minSBP && data.getSystolic() <= this.maxSBP
                && data.getDiastolic() >= this.minDBP && data.getDiastolic() <= this.maxDBP
                && data.getHeartBeat() <= Constant.LOW_HB
                ? result : null;
    }
}
